home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / tcl67.lha / tcl6.7 / Makefile < prev    next >
Makefile  |  1993-02-10  |  4KB  |  129 lines

  1. #
  2. # This Makefile is for use when distributing Tcl to the outside world.
  3. # It is normally set up by running the "config" script.  Before modifying
  4. # this file by hand, you should read through the "config" script to see
  5. # what it does.
  6. #
  7. # Some changes you may wish to make here:
  8. #
  9. # 1. To compile for non-UNIX systems (so that only the non-UNIX-specific
  10. # commands are available), change the OBJS line below so it doesn't
  11. # include ${UNIX_OBJS}.  Also, add the switch "-DTCL_GENERIC_ONLY" to
  12. # CFLAGS.  Lastly, you'll have to provide your own replacement for the
  13. # "panic" procedure (see panic.c for what the current one does).
  14.  
  15. # 2. ANSI-C procedure prototypes are turned on by default if supported
  16. # by the compiler.  To turn them off, uncomment the following line:
  17.  
  18. # NP =        -DNO_PROTOTYPE
  19.  
  20. # 3. If you want to put Tcl-related information in non-standard places,
  21. # change the following definitions below to reflect where you want
  22. # things (all must be specified as full rooted path names):
  23. #
  24. #    INSTALL_DIR    Top-level directory in which to install;  contains
  25. #            each of the other directories below.
  26. #    TCL_LIBRARY    Directory in which to install the library of Tcl
  27. #            scripts.  Note: if the TCL_LIBRARY environment
  28. #            variable is specified at run-time then Tcl looks
  29. #            there rather than in the place specified here.
  30. #    LIB_DIR        Directory in which to install the archive libtcl.a
  31. #    INCLUDE_DIR    Directory in which to install include files.
  32. #    MAN3_DIR        Directory in which to install manual entries for
  33. #            library procedures such as Tcl_Eval.
  34. #    MANN_DIR        Directory in which to install manual entries for
  35. #            miscellaneous things such as the Tcl overview
  36. #            manual entry.
  37. #    RANLIB        If you're using a System-V-based UNIX that doesn't
  38. #            have ranlib, change this definition to "echo" or
  39. #            something else harmless.
  40. #    SHELL        Some versions of make (e.g. SGI's) use this variable
  41. #            to determine which shell to use for executing
  42. #            commands.
  43.  
  44. INSTALL_DIR =    /usr/local
  45. TCL_LIBRARY =    $(INSTALL_DIR)/lib/tcl
  46. LIB_DIR =    $(INSTALL_DIR)/lib
  47. INCLUDE_DIR =    $(INSTALL_DIR)/include
  48. MAN3_DIR =    $(INSTALL_DIR)/man/man3
  49. MANN_DIR =    $(INSTALL_DIR)/man/mann
  50. RANLIB =    ranlib
  51. SHELL =        /bin/sh
  52.  
  53. CC =        cc
  54. CFLAGS =    -O -I. -DTCL_LIBRARY=\"${TCL_LIBRARY}\" ${NP}
  55.  
  56. GENERIC_OBJS =    regexp.o tclAssem.o tclBasic.o tclCkalloc.o \
  57.     tclCmdAH.o tclCmdIL.o tclCmdMZ.o tclExpr.o tclGet.o \
  58.     tclHash.o tclHistory.o tclParse.o tclProc.o tclUtil.o \
  59.     tclVar.o
  60.  
  61. UNIX_OBJS = panic.o tclEnv.o tclGlob.o tclUnixAZ.o tclUnixStr.o \
  62.     tclUnixUtil.o 
  63.  
  64. COMPAT_OBJS =
  65.  
  66. OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS}
  67.  
  68. all: libtcl.a
  69.  
  70. libtcl.a: ${OBJS}
  71.     rm -f libtcl.a
  72.     ar cr libtcl.a ${OBJS}
  73.     $(RANLIB) libtcl.a
  74.  
  75. install: libtcl.a
  76.     -if [ ! -d $(LIB_DIR) ] ; then mkdir -p $(LIB_DIR); fi
  77.     -if [ ! -d $(TCL_LIBRARY) ] ; then mkdir -p $(TCL_LIBRARY); fi
  78.     -if [ ! -d $(INCLUDE_DIR) ] ; then mkdir -p $(INCLUDE_DIR); fi
  79.     -if [ ! -d $(MAN3_DIR) ] ; then mkdir -p $(MAN3_DIR); fi
  80.     -if [ ! -d $(MANN_DIR) ] ; then mkdir -p $(MANN_DIR); fi
  81.     rm -rf $(TCL_LIBRARY)/*
  82.     for i in library/*.tcl library/tclIndex; \
  83.         do \
  84.         cp $$i $(TCL_LIBRARY);  \
  85.         done
  86.     rm -f $(LIB_DIR)/libtcl.a
  87.     cp libtcl.a $(LIB_DIR)
  88.     $(RANLIB) $(LIB_DIR)/libtcl.a
  89.     rm -f $(INCLUDE_DIR)/tcl.h $(INCLUDE_DIR)/tclHash.h
  90.     cp tcl.h $(INCLUDE_DIR)
  91.     cp tclHash.h $(INCLUDE_DIR)
  92.     cd doc; for i in *.3; \
  93.         do \
  94.         rm -f $(MAN3_DIR)/$$i; \
  95.         sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
  96.             $$i > $(MAN3_DIR)/$$i; \
  97.         done; cd ..
  98.     cd doc; for i in *.n; \
  99.         do \
  100.         rm -f $(MANN_DIR)/$$i; \
  101.         sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
  102.             $$i > $(MANN_DIR)/$$i; \
  103.         done; cd ..
  104.  
  105. tclTest: tclTest.o libtcl.a
  106.     ${CC} ${CFLAGS} tclTest.o libtcl.a -o tclTest
  107.  
  108. test: tclTest
  109.     ( echo cd tests ; echo source all ) | ./tclTest
  110.  
  111. configured:
  112.     @echo "The configuration script \"./config\" hasn't been run"
  113.     @echo "successfully yet.  Please run it as described in the "
  114.     @echo "README file, then run make again."
  115.     exit 1
  116.  
  117. clean:
  118.     rm -f ${OBJS} libtcl.a tclTest.o tclTest
  119.  
  120. # The following target is used during configuration to compile
  121. # a test program to see if certain facilities are available on
  122. # the system.
  123.  
  124. configtest:
  125.     ${CC} ${CFLAGS} test.c
  126.  
  127. ${OBJS}: tcl.h tclHash.h tclInt.h configured
  128. ${UNIX_OBJS}: tclUnix.h
  129.